package com.glacier.excel.domain.builder;

import com.glacier.excel.domain.HeaderMeta;
import com.glacier.excel.domain.SheetMeta;

import java.util.List;

/**
 * date 2021-06-15 14:48
 *
 * @author glacier
 * @version 1.0
 */
public final class SheetMetaBuilder {
    private String title;
    private String sheetName;
    private String explain;
    private List<HeaderMeta> headerMetas;
    
    private SheetMetaBuilder() {
    }
    
    public static SheetMetaBuilder aSheetMeta() {
        return new SheetMetaBuilder();
    }
    
    public SheetMetaBuilder withTitle(String title) {
        this.title = title;
        return this;
    }
    
    public SheetMetaBuilder withSheetName(String sheetName) {
        this.sheetName = sheetName;
        return this;
    }
    
    public SheetMetaBuilder withExplain(String explain) {
        this.explain = explain;
        return this;
    }
    
    public SheetMetaBuilder withHeaderMetas(List<HeaderMeta> headerMetas) {
        this.headerMetas = headerMetas;
        return this;
    }
    
    public SheetMeta build() {
        SheetMeta sheetMeta = new SheetMeta();
        sheetMeta.setTitle(title);
        sheetMeta.setSheetName(sheetName);
        sheetMeta.setExplain(explain);
        sheetMeta.setHeaderMetas(headerMetas);
        return sheetMeta;
    }
}
